/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.task.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.task.model.*;
import com.tech15.task.dao.*;
import com.tech15.task.service.*;
import com.tech15.task.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "TASK_DEPT")
public class TaskDept extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "任务主送部门";
	public static final String ALIAS_TDID = "序号";
	public static final String ALIAS_TASKID = "任务id";
	public static final String ALIAS_DEPTID = "任务部门";
	public static final String ALIAS_SENDTYPE = "发送类型（1主送 2抄送）";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: TDID 
     */ 	
	
	private Long tdid;
    /**
     * 任务id       db_column: TASKID 
     */ 	
	
	private Long taskid;
    /**
     * 任务部门       db_column: DEPTID 
     */ 	
	
	private Long deptid;
	/**
     * 发送类型（1主送 2抄送）       db_column: SENDTYPE 
     */ 	
	@Max(127)
	private Integer sendtype;
	//columns END


	public TaskDept(){
	}

	public TaskDept(
		Long tdid
	){
		this.tdid = tdid;
	}

	

	public void setTdid(Long value) {
		this.tdid = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "TDID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getTdid() {
		return this.tdid;
	}
	
	@Column(name = "TASKID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getTaskid() {
		return this.taskid;
	}
	
	public void setTaskid(Long value) {
		this.taskid = value;
	}
	
	@Column(name = "DEPTID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getDeptid() {
		return this.deptid;
	}
	
	public void setDeptid(Long value) {
		this.deptid = value;
	}
	
	@Column(name = "SENDTYPE", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getSendtype() {
		return this.sendtype;
	}
	
	public void setSendtype(Integer value) {
		this.sendtype = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Tdid",getTdid())
			.append("Taskid",getTaskid())
			.append("Deptid",getDeptid())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getTdid())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof TaskDept == false) return false;
		if(this == obj) return true;
		TaskDept other = (TaskDept)obj;
		return new EqualsBuilder()
			.append(getTdid(),other.getTdid())
			.isEquals();
	}
}

